home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CICA 1993 April
/
CICA MS Windows - April 1993.iso
/
unzipped
/
programr
/
vbasic
/
scroll
/
scroll.txt
< prev
Wrap
Text File
|
1991-07-11
|
2KB
|
52 lines
Sub Form_Resize ()
' Repostioin scrollbars and parent picture control
VScroll1.Move ScaleWidth - VScroll1.Width, 0, VScroll1.Width, ScaleHeight - HScroll1.Height
HScroll1.Move 0, ScaleHeight - HScroll1.Height, ScaleWidth - VScroll1.Width
Picture1.Move 0, 0, VScroll1.Left, HScroll1.Top
' Enable or Disable VScroll1 depending on new size of Form
VScroll1.Value = 0 'Generates VScroll1_Change() event
VDiff = Picture1.ScaleHeight - Picture2.Height
VScroll1.Enabled = VDiff <= 0
If VScroll1.Enabled Then
VScroll1.Max = Abs(VDiff)
VScroll1.LargeChange = VScroll1.Max \ 10
End If
' Enable or Disable HScroll1 depending on new size of Form
HScroll1.Value = 0
HDiff = Picture1.ScaleWidth - Picture2.Width
HScroll1.Enabled = HDiff <= 0
If HScroll1.Enabled Then
HScroll1.Max = Abs(HDiff)
HScroll1.LargeChange = HScroll1.Max \ 10
End If
End Sub
Sub HScroll1_Change ()
' Picture.Left is set to the Negative of the value since
' as you scroll the Scrollbar to the Right, the display
' should move to the Left, showing more of the right
' of the display, and vice-versa when scrolling to the
' left
Picture2.Left = -HScroll1.Value
End Sub
Sub VScroll1_Change ()
' Picture.Top is set to the Negative of the value since
' as you scroll the Scrollbar down, the display
' should move up, showing more of the the bottom
' of the display, and vice-versa when scrolling up
Picture2.Top = -VScroll1.Value
End Sub